//
//  YDYLoginViewController.m
//  DYSisterAPP
//
//  Created by 杨德勇 on 16/7/27.
//  Copyright © 2016年 杨德勇. All rights reserved.
//

#import "YDYLoginViewController.h"

@interface YDYLoginViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftMargin;

@end

@implementation YDYLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

-(UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}
- (IBAction)qqZoneClick:(id)sender {
}
- (IBAction)weiboClick:(id)sender {
}
- (IBAction)qqClick:(id)sender {
}
- (IBAction)cancleClick:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        YDYLog(@"woooo");
    }];
}
- (IBAction)loginOrRegisterClick:(UIButton *)sender {
    [self.view endEditing:YES];
    
    if (self.leftMargin.constant) {
        //如果有值，说明是注册界面
        self.leftMargin.constant = 0;
        [sender setTitle:@"注册账号" forState:UIControlStateNormal];
    }else{
        self.leftMargin.constant = -self.view.bounds.size.width;
        [sender setTitle:@"已有账号?" forState:UIControlStateNormal];
    }
    
    [UIView animateWithDuration:0.25 animations:^{
        [self.view layoutIfNeeded];
    }];
    
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [self.view endEditing:YES];
    
}

@end
